package com.northpool.operator.http.bean;

import javax.xml.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;

@XmlRootElement(name = "startApi")
@XmlAccessorType(XmlAccessType.FIELD)
public class StartApiBean {
    @XmlElement(
            name = "url"
    )
    String url;
    @XmlElement(
            name = "method"
    )
    RequestMethodEnum method;
    @XmlElement(
            name = "timeout"
    )
    Integer timeout;
    @XmlElementWrapper(
            name = "startParam"
    )
    @XmlElement(
            name = "param"
    )
    List<ExpParamBean> startParam;
    @XmlElementWrapper(
            name = "headers"
    )
    @XmlElement(
            name = "header"
    )
    List<HeaderBean> headers = new ArrayList<>();
    @XmlElement(
            name = "body"
    )
    String body;

    @XmlElement(
            name = "errorTimes"
    )
    Integer errorTimes;

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public RequestMethodEnum getMethod() {
        return method;
    }

    public void setMethod(RequestMethodEnum method) {
        this.method = method;
    }

    public Integer getTimeout() {
        return timeout;
    }

    public void setTimeout(Integer timeout) {
        this.timeout = timeout;
    }

    public List<ExpParamBean> getStartParam() {
        return startParam;
    }

    public void setStartParam(List<ExpParamBean> startParam) {
        this.startParam = startParam;
    }

    public List<HeaderBean> getHeaders() {
        return headers;
    }

    public void setHeaders(List<HeaderBean> headers) {
        this.headers = headers;
    }

    public String getBody() {
        return body;
    }

    public void setBody(String body) {
        this.body = body;
    }

    public Integer getErrorTimes() {
        return errorTimes;
    }

    public void setErrorTimes(Integer errorTimes) {
        this.errorTimes = errorTimes;
    }
}
